package ${package.Entity}

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.yl.common.annotation.NoArg
<#if swagger2>
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
</#if>
/**
 * <p>
 *
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@NoArg
@TableName("${table.name}")
<#if superEntityClass??>
class ${entity} : ${superEntityClass}<#if activeRecord><${entity}></#if> {
<#elseif activeRecord>
class ${entity} : Model<${entity}>() {
<#else>
    data class ${entity}  (
</#if>

<#-- ----------  BEGIN 字段循环遍历  ---------->
<#list table.fields as field>
<#if field.keyFlag>
    <#assign keyPropertyName="${field.propertyName}"/>
</#if>
<#if field.comment!?length gt 0>
<#if swagger2>
        @ApiModelProperty(value = "${field.comment}")
<#else>
    /**
     * ${field.comment}
     */
</#if>
</#if>
<#if field.keyFlag>
    @TableId(value = "${field.annotationColumnName}", type = IdType.AUTO)
<#else >
<#-- 普通字段 -->
    @TableField("${field.annotationColumnName}")
</#if>
    <#if field.propertyType == "Integer">
    var ${field.propertyName}: Int? = null
    <#else>
    var ${field.propertyName}: ${field.propertyType}? = null,
    </#if>

</#list>
<#-- ----------  END 字段循环遍历  ---------->
)
